using Volo.Abp.Modularity;

namespace WL.Think.Abp.Modules
{
    public abstract class ThinkModule : AbpModule
    {
    }

    public abstract class ThinkModule<TModule> : ThinkModule where TModule : ThinkModule<TModule>
    {
        public override void PreConfigureServices(ServiceConfigurationContext context)
        {
            PreConfigureOptions(context);
            PreConfigureDataAnnotationsLocalization(context);
            PreConfigureDbContext(context);
            PreConfigureOpenIddict(context);
            PreConfigureWebComponents(context);
            PreConfigureOther(context);
        }

        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            ConfigureOptions(context);
            ConfigureJson(context);
            ConfigureOpenIddict(context);
            ConfigureAuthentication(context);
            ConfigureControllers(context);
            ConfigureHealthChecks(context);
            ConfigureSwagger(context);
            ConfigureApiVersion(context);
            ConfigureCors(context);
            ConfigureAntiForgery(context);
            ConfigureVirtualFileSystem(context);
            ConfigureLocalization(context);
            ConfigureDbContext(context);
            ConfigureMultiTenancy(context);
            ConfigureAutoMapper(context);
            ConfigureWebComponents(context);
            ConfigureMenu(context);
            ConfigureRouter(context);
            ConfigureBundles(context);
            ConfigureOther(context);
        }

        /// <summary>
        /// 配置JSON参数
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureJson(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 配置OpenIddict参数
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureOpenIddict(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置认证信息
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureAuthentication(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置控制器参数
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureControllers(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置健康检查
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureHealthChecks(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置接口文档
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureSwagger(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置API版本管理
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureApiVersion(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置跨域
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureCors(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置跨站请求伪造
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureAntiForgery(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置虚拟文件系统
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureVirtualFileSystem(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 配置本地化
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureLocalization(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 配置数据库上下文
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureDbContext(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置多租户
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureMultiTenancy(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 配置实体自动映射
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureAutoMapper(ServiceConfigurationContext context)
        {
            
        }

        /// <summary>
        /// 配置Option选项
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureOptions(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 配置Web组件或者Blazor组件
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureWebComponents(ServiceConfigurationContext context)
        {
  
        }

        /// <summary>
        /// 配置资源打包与压缩
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureBundles(ServiceConfigurationContext context)
        {
        }

        /// <summary>
        /// 配置菜单
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureMenu(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 配置路由
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureRouter(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 配置额外信息
        /// </summary>
        /// <param name="context"></param>
        protected virtual void ConfigureOther(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 预配置数据标注本地化
        /// </summary>
        /// <param name="context"></param>
        protected virtual void PreConfigureDataAnnotationsLocalization(ServiceConfigurationContext context)
        {
        }

        /// <summary>
        /// 预配置Web组件
        /// </summary>
        /// <param name="context"></param>
        protected virtual void PreConfigureWebComponents(ServiceConfigurationContext context)
        {
        }

        /// <summary>
        /// 预配置数据库上下文
        /// </summary>
        /// <param name="context"></param>
        protected virtual void PreConfigureDbContext(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 预配置Option选项
        /// </summary>
        /// <param name="context"></param>
        protected virtual void PreConfigureOptions(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 预配置OpenIddict服务
        /// </summary>
        /// <param name="context"></param>
        protected virtual void PreConfigureOpenIddict(ServiceConfigurationContext context)
        {

        }

        /// <summary>
        /// 预配置其他信息
        /// </summary>
        /// <param name="context"></param>
        protected virtual void PreConfigureOther(ServiceConfigurationContext context)
        {

        }
    }
}
